home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hardcore Visual Basic 5.0 (2nd Edition)
/
Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso
/
Code
/
List.pag
< prev
next >
Wrap
Text File
|
1997-06-14
|
4KB
|
141 lines
VERSION 5.00
Begin VB.PropertyPage List
Caption = "List"
ClientHeight = 3495
ClientLeft = 0
ClientTop = 0
ClientWidth = 5925
PaletteMode = 0 'Halftone
ScaleHeight = 3495
ScaleWidth = 5925
Begin VB.TextBox txtList
Height = 285
Left = 240
TabIndex = 2
Top = 480
Width = 2055
End
Begin VB.TextBox txtItemData
Height = 285
Left = 2280
TabIndex = 3
Top = 480
Width = 1215
End
Begin VB.ListBox lstItemData
Height = 2400
ItemData = "List.pgx":0000
Left = 2280
List = "List.pgx":0002
TabIndex = 1
TabStop = 0 'False
Top = 840
Width = 1215
End
Begin VB.ListBox lstList
Height = 2400
ItemData = "List.pgx":0004
Left = 240
List = "List.pgx":0006
TabIndex = 0
TabStop = 0 'False
Top = 840
Width = 2055
End
Begin VB.CommandButton cmdRemove
Caption = "Remove"
Height = 375
Left = 4080
TabIndex = 5
Top = 1200
Width = 1215
End
Begin VB.CommandButton cmdAdd
Caption = "Add"
Height = 375
Left = 4080
TabIndex = 4
Top = 600
Width = 1215
End
Begin VB.Label lbl
Caption = "List"
Height = 255
Index = 0
Left = 240
TabIndex = 7
Top = 240
Width = 2055
End
Begin VB.Label lbl
Caption = "Item Data"
Height = 255
Index = 1
Left = 2280
TabIndex = 6
Top = 240
Width = 1215
End
End
Attribute VB_Name = "List"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Private Sub cmdAdd_Click()
If txtList <> sEmpty Then
lstList.AddItem txtList
lstItemData.AddItem Trim$(Val(txtItemData))
txtList = sEmpty
txtItemData = sEmpty
txtList.SetFocus
Changed = True
End If
End Sub
Private Sub cmdRemove_Click()
If lstList.ListIndex <> -1 And lstItemData.ListIndex <> -1 Then
lstList.RemoveItem lstList.ListIndex
lstItemData.RemoveItem lstItemData.ListIndex
Changed = True
End If
End Sub
Private Sub lstItemData_Click()
Static fInClick As Boolean
If fInClick Then Exit Sub
fInClick = True
lstList.ListIndex = lstItemData.ListIndex
fInClick = False
End Sub
Private Sub lstList_Click()
Static fInClick As Boolean
If fInClick Then Exit Sub
fInClick = True
lstItemData.ListIndex = lstList.ListIndex
fInClick = False
End Sub
Private Sub PropertyPage_ApplyChanges()
With SelectedControls(0)
Dim i As Integer
.Clear
If lstList.ListCount Then
For i = 0 To lstList.ListCount - 1
.Add lstList.List(i), , CLng(lstItemData.List(i))
Next
End If
End With
End Sub
Private Sub PropertyPage_SelectionChanged()
With SelectedControls(0)
Dim i As Integer
For i = 0 To .ListCount - 1
lstList.List(i) = .List(i)
lstItemData.List(i) = .ItemData(i)
Next
End With
End Sub